<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<%@ page contentType="text/html; charset=utf-8"%>
	<%@ include file="/commons/taglibs.jsp"%>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
		<title>平台类型管理</title>

		<%@ include file="/commons/css_js_head.jsp"%>
		<script type="text/javascript">
//复写Url
doListUrl = "${ctx }/base/userMachineTypeAction!doList.ts";
doAddBeforeUrl = "${ctx }/base/tsOptionsAction!doFindById.ts?code=${code}";
doUpdateBeforeUrl = "${ctx }/base/userMachineTypeAction!doFindById.ts?code=${code}";
doDelUrl = "${ctx }/base/userMachineTypeAction!doDelete.ts?code=${code}"
//添加之前
function doAddBefore() {
	var _form = document.forms[0];
	if (doAddBeforeUrl == '') {
		alert('请设置正确的URL!');
		return false;
	}

	_form.action = doAddBeforeUrl;
	_form.submit();
}

//更新之前 
function doUpdateBefore(pkId) {
	var _form = document.forms[0];
	if (doUpdateBeforeUrl == '') {
		alert('请设置正确的URL!');
		return false;
	}
  
	//_form.action = doUpdateBeforeUrl + "&theIdMachine=" + pkId;
	//_form.submit();
	
	tb_show("add","${ctx }/base/userMachineTypeAction!doFindById.ts?code=${code}&theIdMachine="+ pkId+"&keepThis=true&TB_iframe=true&width=800&height=350&modal=true",false);
	
}

//删除
function doDel(pkId) {
	var _form = document.forms[0];
	if (doDelUrl == '') {
		alert('请设置正确的URL!');
		return false;
	}
	if(confirm("确定删除?"))
		{
				_form.action = doDelUrl + "&theIdMachine=" + pkId;
				_form.submit();
		}

}

function isDel(flag){
	if(flag =="No"){
		alert('该类型已添加终端平台');
	}
	
}

//添加应用平台之前列出该类型未添加的应用平台
function doAddBefore1(nid) {
	tb_show("update","${ctx }/base/typeAuditAction!doMyApply.ts?nid=" + nid+"&keepThis=true&TB_iframe=true&width=850&height=450&modal=true",false);
}
function doAddBefore2(nid) {
	tb_show("update","${ctx }/base/typeAuditAction!doMyApply.ts?nid=" + nid+"&keepThis=true&TB_iframe=true&width=850&height=450&modal=true",false);
}
 //批量选择
 function checkAll(check,me){   
    // 首先获得所有checkbox集合  
    var names = document.getElementsByName(check); 
    
    var status=me.checked; 
    
    for(var i=0;i<names.length;i++){   
        if(status==true){           
		   names[i].checked=true;}
		else{
		    names[i].checked=false;
		}   
    }   
}  
</script>


	</head>
	<body style="overflow-x: hidden" onload="isDel('${isDelete }')">

		<!-- 标题 -->
		<div class="mTitle">
			<span class="hidsearch"><a href="javascript:void(0)"
				onClick="return chg('searchList');" id="ImgArrow"> <img
						src="${ctx}/images/icon_up.gif" id="imgButton" />
			</a> </span>
			<b class="bbig">信息终端类型管理</b>
			<a href="${ctx }/base/userMachineTypeAction!doFindById.ts" onclick="" >增加信息终端类型</a>
		</div>

		<!--list -->
		<div class="searchBar" id="searchList" style="display: block;">
			<form action="${ctx }/base/userMachineTypeAction!doList.ts" method="post">
			<s:hidden name="options.code"></s:hidden>
				<table class="searchTable">
					<tr>
						<th>
							信息终端类型名称：
						</th>
						<td>
							<s:textfield name="name" theme="simple"></s:textfield>
						</td>
						<th>类型</th>
						<td>
							 <s:select
                                 theme="simple"
                                 name="optionId"
                                 list="#request.list" 
                                 cssStyle="width:83px;"	
                                 listKey="theId" 
                                 listValue="name"
                                 headerKey=""
                                 headerValue="请选择类型"
                			     id="select">
							</s:select>
						</td>
						
						
						<td>
							<input name="btn_query" type="button" class="btn" value="查询"
								onclick="doQuery()" />
							
						</td>
					</tr>
				</table>
			</form>
		</div>
		<div class="mainList">

			<table class="listTable">
				<tr>
				    
					<th>序号</th>
					<th>
						信息终端类型名称
					</th>
					
					<th>
						类型
					</th>
					<th>
						创建日期
					</th>
					<th>
						操作
					</th>
				</tr>
				

				<c:forEach var="userMachineType" varStatus="status" items="${pager.data}">
					<tr align=center>
						
						<td>${status.index+1} </td>
						<td>
							${userMachineType.name}
						</td>
						
						<td>
							${userMachineType.optionName }
						</td>
						<td>
							<fmt:formatDate value="${userMachineType.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
						</td>
						
						<td>
							<a href="javascript:void(0)"
								onclick="javascript:doUpdateBefore('${userMachineType.theIdMachine}');"><span
								class="icon_edit">&nbsp;</span>修改</a>
							<a href="javascript:void(0)" onclick="javascript:doDel('${userMachineType.theIdMachine}');"><span
								class="icon_del">&nbsp;</span>删除</a>
							<a href="javascript:void(0)" onclick="javascript:doAddBefore1('${userMachineType.theIdMachine }-${userMachineType.userId },');">
							<span class="icon_add">&nbsp;</span>添加应用平台</a>
						</td>
					</tr>
				</c:forEach>
			</table>
		</div>
		<!--end list -->
		
		<!-- 分页区域  -->
<%@ include file="/page/pager.jsp"%>

<script type="text/javascript">
ajaxAnywhere.formName = "form1";
ajaxAnywhere.getZonesToReload = function() {
    return "zoneList";
}
</script>

	</body>
</html>
